#pragma once

#ifndef _RESOURCE_GROUP_H_
#define _RESOURCE_GROUP_H_

//Inclusiones basicas
#include "wingmotor.h"

//Inclusiones estandar
#include <string>
#include <list>

//Inclusiones de libreria
#include "Resource.h"

//Dependencias
#include <StdTools/LogManager.h>
#include <StdTools/Thread.h>
#include <StdTools/Mutex.h>

namespace GMotor
{
#ifdef WIN
	class GMOTOR_API ResourceGroup : public StdTools::Threads::Runnable
#else
	class ResourceGroup : public StdTools::Threads::Runnable
#endif
	{
	private:
		std::string name;
		bool initialized;
		
		StdTools::Threads::Thread * thread;
		StdTools::Threads::Mutex mutex;

	protected:
		StdTools::LogManager * mLogManager;

		std::list<Resource *> lstResource;

	public:
		ResourceGroup(std::string name,StdTools::LogManager * logManager);
		virtual ~ResourceGroup(void);

		//Getters y Setters
		std::string getName();
		Resource * getResource(std::string name);

		void addResource(Resource * resource);
		bool deleteResource(std::string name);

		void initialize();

		//Metodos de la clase Runnable
		void Run();
	};
}
#endif